import request from '@/utils/request'
import {exportMethod} from '@/utils/utils'
import * as proxy from '@/constants/proxy'

//高端研发平台
// 列表数据 
export function getList(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/hplatform/list',
    method: 'post',
    data
  })
}

//获取详情
export function getDetail(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/hplatform/getDetailById/${id}`,
    method: 'get',
  })
}

//导出
export function getExport(data: any,fileName) {
  const params = {
    method:'post',
    url: proxy.CHECC_API_CMS + '/kjsl/hplatform/export',
    data:data,
    fileName:fileName
  }
  return exportMethod(params)
}

//锁定
export function getLock(id: any) {
  return request({
      url: proxy.CHECC_API_CMS + `/kjsl/hplatform/lock/${id}`,
      method: 'get'
  })
}

//解锁
export function getUnlock(id: any) {
  return request({
      url: proxy.CHECC_API_CMS + `/kjsl/hplatform/unlock/${id}`,
      method: 'get'
  })
}

//修改数据
export function getUpdate(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/hplatform/update',
    method: 'post',
    data
  })
}

//新增人员
export function getAddPeople(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/hplatform/addMember',
    method: 'post',
    data
  })
}

//删除人员
export function delectPeople(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/hplatform/disAssociation/member/${id}`,
    method: 'get'
  })
}

//项目关联
export function addProject(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/hplatform/addProject',
    method: 'post',
    data
  })
}

//取消项目关联
export function delectProject(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/hplatform/disAssociation/project/${id}`,
    method: 'get'
  })
}

//批量删除
export function getDelect(ids: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/hplatform/${ids}`,
    method: 'delete',
  })
}

//新增基础信息
export function getAdd(data: any) {
  return request({
    url: proxy.CHECC_API_CMS + '/kjsl/hplatform/add',
    method: 'post',
    data
  })
}

//新增文件
export function addFiles(data: any) {
  return request({
    url: '/kjsl/hplatform/addFile',
    method: 'post',
    data
  })
}

//确认
export function getConfirm(id: any) {
  return request({
    url: proxy.CHECC_API_CMS + `/kjsl/hplatform/confirm/${id}`,
    method: 'get'
  })
}









